<% content_for :page_title do %>
  <h1>Repositories</h1>
<% end %>
<% content_for :primary_navigation do %>
  <%= link_to 'Add a repository', new_repository_path, class: 'btn secondary' %>
<% end %>

<div class="wrapper <%= 'filtering-enabled' if @repositories.size > 10 %>">
  <section>
    <header class="section-header repository-search-header">
      <input class="repository-search" placeholder="Search <%= @repositories.size %> repositories" />
    </header>
    <ul class="repository-table-header">
      <li class="col">Owner<li>
        <li class="col">Name</li>
    </ul>
    <ul class="repository-lst">
      <% @repositories.each do |repository| %>
        <li class="search-item <%= contributor_class(current_user.repositories_contributed_to, repository.id) %>" data-search="<%= repository.github_repo_name %>" data-repository-id="<%= repository.id %>">
          <%= link_to repository_path(repository), class: 'commits-path' do %>
            <span class="col"><%= repository.owner %></span>
            <span class="col"><%= repository.name %></span>
          <% end %>
        </li>
      <% end %>
    </ul>

    <%= link_to 'show all repositories', '#', class: 'btn secondary show-all-repositories' %></p>
  </section>

</div>
